package unit03.day03;

import java.util.Calendar;

/**
 * 获取某个时间分量所允许的最大值
 * */
public class CalendarDemo3 {

	public static void main(String[] args) {
		//当月共多少天
		Calendar calendar = Calendar.getInstance();
		int days = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
		//查看2016年2月多少天
		calendar.set(Calendar.YEAR, 2016);
		calendar.set(calendar.MONTH, 1);
		int max_day = calendar.getActualMaximum(calendar.DAY_OF_MONTH);
		//今年总共多少天
		int count_day = calendar.getActualMaximum(calendar.DAY_OF_YEAR);
		System.out.println(count_day);
	}

}
